import request from "@/utils/request";

// - U盾基础 -

// 查询币种U盾通道
export function getRechageCoin(coin: string) {
  return request({
    url: `/wallet/udun/base/getRechageCoin?symbol=${coin}`,
    method: "get",
  });
}

// 查询充提币对
export function getWithdrawCoinList() {
  return request({
    url: `/wallet/udun/base/getWithdrawCoinList`,
    method: "get",
  });
}

// 获取币种提币配置
export function withdrawFee() {
  return request({
    url: `/wallet/udun/base/withdrawFee/get`,
    method: "get",
  });
}

// - U盾操作 -

// 获取用户充币地址
export function getAddress(coinType: string) {
  return request({
    url: `/wallet/udun/getAddress?mainCoinType=${coinType}`,
    method: "get",
  });
}

// 发起提币请求
export function withdraw(data: object) {
  return request({
    url: "/wallet/udun/withdraw",
    method: "post",
    data,
  });
}

// - 币种信息 -

// 查询币种简历
export function getCoins(data: object) {
  return request({
    url: "/wallet/coin/get",
    method: "post",
    data,
  });
}

// - 资产查询统计明细等 -

// 流水类型
export function flowKV() {
  return request({
    url: `/wallet/assets/flowKV`,
    method: "get",
  });
}
// 获取资产
export function getAssets() {
  return request({
    url: `/wallet/assets/getAssets`,
    method: "get",
  });
}

// 获取资产（闪兑专用）
export function getAssetsFast() {
  return request({
    url: `/wallet/assets/getAssetsFast`,
    method: "get",
  });
}

// 分页查询用户所有资产明细
export function getPageAssetsLog(data: object) {
  return request({
    url: "/wallet/assets/getPageAssetsLog",
    method: "post",
    data,
  });
}

// 分页查询所有充币记录
export function getPageRechange(data: object) {
  return request({
    url: "/wallet/assets/getPageRechange",
    method: "post",
    data,
  });
}

// 分页查询用户所有提币记录
export function getPageWithdraw(data: object) {
  return request({
    url: "/wallet/assets/getPageWithdraw",
    method: "post",
    data,
  });
}

// - 钱包操作 -

// 购买节点
export function buyNOddde(data: object) {
  return request({
    url: "/wallet/wallet/buyNOddde",
    method: "post",
    data,
  });
}

// 闪兑（只支持现货WF）
export function fastTransfer(data: object) {
  return request({
    url: "/wallet/wallet/fastTransfer",
    method: "post",
    data,
  });
}

// 获取币种汇率
export function findCoinRate() {
  return request({
    url: `/wallet/wallet/findCoinRate`,
    method: "get",
  });
}

// 查询节点明细
export function getNodeInfo(data: object) {
  return request({
    url: "/wallet/wallet/getNodeInfo",
    method: "post",
    data,
  });
}

// 充值记录
export function rechangeRecord() {
  return request({
    url: `/wallet/wallet/rechangeRecord`,
    method: "get",
  });
}

// 划转 (内部转账)
export function transferInner(data: object) {
  return request({
    url: "/wallet/wallet/transferInner",
    method: "post",
    data,
  });
}
// 转账 （转账给其他人资产,目前只支持币币）
export function transferOut(data: object) {
  return request({
    url: "/wallet/wallet/transferOut",
    method: "post",
    data,
  });
}

// 提币记录
export function withdrawRecord() {
  return request({
    url: `/wallet/wallet/withdrawRecord`,
    method: "get",
  });
}




